package a2025_02_21;

import java.util.Scanner;

public class demo1 {
    public static void main(String[] args) {
        Scanner sc=new Scanner(System.in);
        int num1=sc.nextInt();
        int num2=sc.nextInt();
        int min;
        int max;
        if(num1>num2){
            max=num1;
            min=num2;
        }else{
            max=num2;
            min=num1;
        }
        int ret=1;
        for(int i=min;i>=1;i--){
            if(max%i==0){
                ret=i;
                break;
            }
        }
        System.out.println(num1+"和"+num2+"的最大公约数是"+ret);
    }
}
